//T10086. 铲雪车
//因为所有道路都是双车道，一条入一条出，故所有的节点的度数都是偶数
//所以构成欧拉回路，故可以一笔画完
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;
long long a, b;
long long a1, b1, a2, b2;
double totalway;
double totaltime;
int main() {
    cin >> a >> b;
    while (cin >> a1) {
        cin >> b1 >> a2 >> b2;
        totalway += sqrt((a1 - a2) * (a1 - a2) + (b1 - b2) * (b1 - b2));
    }

    totaltime = totalway * 2 / 1000 / 20;
    long long  hour = (long long)totaltime;
    long long  miniter = round((totaltime - hour) * 60);
    cout << hour << ':' <<setfill('0')<<setw(2)<<miniter;
}